# $Id: PKGBUILD 58044 2011-11-05 19:35:56Z lcarlier $
# Maintainer: Jan de Groot <jgc@archlinux.org>
# Contributor: Alexander Baldeck <alexander@archlinux.org>

_pkgbasename=libpciaccess
pkgname=lib32-${_pkgbasename}
pkgver=0.12.1
pkgrel=3
pkgdesc="X11 PCI access library (32-bit"
arch=(i686 x86_64)
license=('custom')
url="http://xorg.freedesktop.org/"
depends=('lib32-glibc' ${_pkgbasename})
makedepends=('gcc-multilib' 'pkgconfig' 'xorg-util-macros')
options=('!libtool')
source=(${url}/releases/individual/lib/${_pkgbasename}-${pkgver}.tar.bz2)
sha1sums=('4933bda545df37395e57ff6b4bd61e17a5431770')

build() {
  cd "${srcdir}/${_pkgbasename}-${pkgver}"

  export CC="gcc -m32"
  export CXX="g++ -m32"
  export PKG_CONFIG_PATH="/usr/lib32/pkgconfig"

  ./configure --prefix=/usr --sysconfdir=/etc \
    --libdir=/usr/lib32
  make

  make DESTDIR="${pkgdir}" install

  rm -rf "${pkgdir}"/usr/include
  mkdir -p "$pkgdir/usr/share/licenses"
  ln -s $_pkgbasename "$pkgdir/usr/share/licenses/$pkgname"
}
